The data sets for this project are download from Kaggle. My goal for this project is not to participate in the competition, but to use the data sets to practice my analytic skills as well as just having fun working with interesting data.
Before doing any analysis, let’t take a look at the data.
The main data set has about 15000 records and 24 fields, and each record contains information for a listing for pet adoption. These fields provide various information about the pets, such as name, gender, age, appearance, and pre-treatment.
| No. | field | total_n | num_missing | data_type | example_values |
|---|---|---|---|---|---|
| 1 | Type | 14993 | 0 | integer | 2, 1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA |
| 2 | Name | 14993 | 1257 | character | Nibble, No Name Yet, Brisco, Miko, Hunter, NA, BULAT, Siu Pak & Her 6 Puppies, Kitty, Bear, Kali, Peanut, 2 Mths Old Cute Kitties, Lost Dog, Max, Brownie, Blackie, Beauty, Godiva, Tigers |
| 3 | Age | 14993 | 0 | integer | 3, 1, 4, 12, 0, 2, 78, 6, 8, 10, 36, 14, 24, 5, 72, 60, 9, 48, 62, 47 |
| 4 | Breed1 | 14993 | 0 | integer | 299, 265, 307, 266, 264, 218, 114, 285, 189, 205, 292, 128, 243, 213, 141, 173, 207, 250, 119, 195 |
| 5 | Breed2 | 14993 | 0 | integer | 0, 264, 205, 307, 117, 251, 265, 218, 292, 266, 285, 141, 128, 96, 76, 169, 306, 18, 36, 303 |
| 6 | Gender | 14993 | 0 | integer | 1, 2, 3, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA |
| 7 | Color1 | 14993 | 0 | integer | 1, 2, 5, 6, 3, 7, 4, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA |
| 8 | Color2 | 14993 | 0 | integer | 7, 2, 0, 6, 5, 4, 3, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA |
| 9 | Color3 | 14993 | 0 | integer | 0, 7, 5, 6, 4, 3, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA |
| 10 | MaturitySize | 14993 | 0 | integer | 1, 2, 3, 4, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA |
| 11 | FurLength | 14993 | 0 | integer | 1, 2, 3, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA |
| 12 | Vaccinated | 14993 | 0 | integer | 2, 3, 1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA |
| 13 | Dewormed | 14993 | 0 | integer | 2, 3, 1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA |
| 14 | Sterilized | 14993 | 0 | integer | 2, 3, 1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA |
| 15 | Health | 14993 | 0 | integer | 1, 2, 3, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA |
| 16 | Quantity | 14993 | 0 | integer | 1, 6, 7, 5, 3, 10, 2, 9, 4, 8, 20, 18, 12, 11, 14, 17, 16, 13, 15, NA |
| 17 | Fee | 14993 | 0 | integer | 100, 0, 150, 300, 50, 10, 1, 30, 750, 400, 80, 20, 250, 200, 60, 120, 40, 500, 15, 135 |
| 18 | State | 14993 | 0 | integer | 41326, 41401, 41330, 41327, 41361, 41336, 41324, 41335, 41325, 41332, 41345, 41342, 41367, 41415, NA, NA, NA, NA, NA, NA |
| 19 | RescuerID | 14993 | 0 | character | 8480853f516546f6cf33aa88cd76c379, 3082c7125d8fb66f7dd4bff4192c8b14, fa90fa5b1ee11c86938398b60abc32cb, 9238e4f44c71a75282e62f7136c6b240, 95481e953f8aed9ec3d16fc4509537e8, 22fe332bf9c924d4718005891c63fbed, 1e0b5a458b5b77f5af581d57ebf570b3, 1fba5f6e5480946254590d48f9c5198d, d8af7afece71334473575c9f70daf00d, 1f3f36e4b18e94855b3e88af0852fdc4, a9caef3f98e67bfac9093cca79e20b93, db784cbcf321e1d8856b312638b94113, 2c118b2a1d1b4cf1f735089c7c0a07c0, b609c40c6c840db208b149a19b856f86, 39112c637c80a6055e8ec544416abffe, 58e3aa0b4b78e8879f81774ede0646fe, 4e3dec1544d1407fce5d65fd0f037e26, b752f78276215f44581eeb6eea1e63bc, a042471e0f43f2cf707104a1a138a7df, fa7cd6caa034d4332fc75d70807e83a3 |
| 20 | VideoAmt | 14993 | 0 | integer | 0, 1, 3, 4, 2, 6, 5, 7, 8, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA |
| 21 | Description | 14993 | 0 | character | Nibble is a 3+ month old ball of cuteness. He is energetic and playful. I rescued a couple of cats a few months ago but could not get them neutered in time as the clinic was fully scheduled. The result was this little kitty. I do not have enough space and funds to care for more cats in my household. Looking for responsible people to take over Nibble’s care., I just found it alone yesterday near my apartment. It was shaking so I had to bring it home to provide temporary care., Their pregnant mother was dumped by her irresponsible owner at the roadside near some shops in Subang Jaya. Gave birth to them at the roadside. They are all healthy and adorable puppies. Already dewormed, vaccinated and ready to go to a home. No tying or caging for long hours as guard dogs. However, it is acceptable to cage or tie for precautionary purposes. Interested to adopt pls call me., Good guard dog, very alert, active, obedience waiting for her good master, plz call or sms for more details if you really get interested, thanks!!, This handsome yet cute boy is up for adoption. He is the most playful pal we’ve seen in our puppies. He loves to nibble on shoelaces , Chase you at such a young age. Imagine what a cute brat he will be when he grows. We are looking for a loving home for Hunter , one that will take care of him and give him the love that he needs. Please call urgently if you would like to adopt this cutie., This is a stray kitten that came to my house. Have been feeding it, but cannot keep it., anyone within the area of ipoh or taiping who interested to adopt my cat can contact my father at this number (mazuvil)or can just email me. currently bulat is at my hometown at perak but anyone outside the area still want to adopt can travel there to my hometown.there is a lot of cats in my house rite now..i think i should let one of them go to a better owner who can give better attention to him., Siu Pak just give birth on 13/6/10 to 6puppies. Interested pls call or sms me. Left 2female puppies on 2/7/10, healthy and active, feisty kitten found in neighbours’ garden. Not sure of sex., Very manja and gentle stray cat found, we would really like to find a home for it because we cannot keep her for ourselves for long. Has a very cute high pitch but soft meow. Please contact me if you would be interested in adopting., For serious adopter, please do sms or call for more details, thanks!, Kali is a super playful kitten who is on the go the minute she wakes up. She is very quiet and only meows very rarely. She likes to cuddle when she is sleepy and also when she wakes up from a nap. As long as she has her toys, she keeps herself active and busy during the day. Would recommend you spend at least half an hour every night to play with her as it is her normal routine now. Would recommend that you house her alone as a single cat or with another kitten. She has had her second vaccination and deworming and needs another one next month. Serious adopters only please. Looking for a good forever home for Kali. For more info/photos please whatsapp, Peanut was an abused puppy until he was rescued. He was very scared of people but now he is a very happy and active puppy! He is a really loving puppy now. (: Lester Jenny Will you adopt him? ================================================== Adopters are required to vaccinate and neuter them. ==================================================, Hi Pet Lovers! This is my first posting and I need help! 3 months ago we befriended a mother stray cat with 3 kittens in our area and we ‘adopted’ them but they come and go as they please. 2 months ago the mother gave birth to a litter of 7 cute kittens and we have been taking care of the mother and the kittens ever since in our home…in the ground floor bathroom! Some of the kittens look half-persian with long hair,evident also from the earlier stray batch we adopted. Looking for good caring homes…, Lost Dog Found (Bandar Menjalara, Kepong/Taman Bukit Maluri or Desa Park City) 迷途犬被尋獲 (甲洞孟加拉惹/武吉馬魯里/Desa Park City) Area lost puppy found 小狗被發現地點:Bandar Sri Menjalara, Kepong, KL, Malaysia 大馬吉隆坡甲洞孟加拉惹 How the lost dog found 狗兒如何被發現: The lost puppy entered my staying place itself. 迷途小狗自行進我居住地。 Condition 情況: 雖好像幾天沒進食。看起來健康。頸上系有紅帶。目前甲洞孟加拉惹住宅區保安處看顧。Few days without food. Looks healthy. Neck tied with red belt. Currently taken care by security guard of housing area of Bandar Menjalara., We moved out of our apartment to a landed home and there were many friendly strays in the neighbourhood. My grandma’s neighbour was moving homes and was looking for a home for their pet.I pleaded with my mom to let us adopt him and he’s fun-loving, he plays football and is a great goalie yet a loyal guardog. Now we are moving abroad and Max has no home., to be spayed on /12 adorable & friendly, shes active… she can obey wht command that u told her.. example shakeshand . sleep and eat .. command in english n tamil :).. she will bark if thr suspicius ppl… good for guard act like a male dog..she will sleept in mattres or cradle..whn she eat u can even touch her…we let her because no time to care she… so anyybody intrested to addopt plss call to.. im Mr.Tom..thx petfinder.., This cutie dumped by it’s owner at the market and almost kill by the car, after kicking by the guy, trying to hide herself for safe under the car while the driver is ready to run, ran to her hit on the car to notice the driver stop before i pulled her out and safe her. Luckily the kindness factory guy is allowed me to keep her there, cause my shop is full with 19 dogs and cats, situation not allow me to take in more, due to my work i could only feed her once a day and clean her cage. She’s a black beauty, about 2months +, if anyone able to give her a forever home, please do directly contact with me or sms me,thanks! And PLEASE the more i can rehome, the more i can rescue!, Birth Date: Oct 30th Kitty 1, Melly -Female Sangat comel and vokal. Kitty 2, Tootsie - Male Badan putih, tapi ekor hitam and telinga kekuning-kuningan, macam kucing 3 color. Kitty 3, Bo -Male Corak badan 3 tompok, he is one of the most quite and lightest kitty of the litter tapi jantan. Kitty 4, Michii - Female Macam abang kembar, she is very subtle and sweet, have 1 big spot behind her back and 1 super cute spot belakang telinga. Kitty 5, Missy - Female. She is very curious and adventurous. Very lovable, with sweet voice ! |
| 22 | PetID | 14993 | 0 | character | 86e1089a3, 6296e909a, 3422e4906, 5842f1ff5, 850a43f90, d24c30b4b, 1caa6fcdb, 97aa9eeac, c06d167ca, 7a0942d61, 8b693ca84, 8e76c8e39, aaedd873d, 4a9793dfb, c02be41e6, 1fd342e17, b38a74866, f9d07d5fa, 1c92ce464, b10e7605a |
| 23 | PhotoAmt | 14993 | 0 | numeric | 1, 2, 7, 8, 3, 9, 6, 5, 0, 19, 11, 4, 13, 15, 21, 18, 12, 10, 24, 14 |
| 24 | AdoptionSpeed | 14993 | 0 | integer | 2, 0, 3, 1, 4, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA |
As can be seen from the raw data, some information for categorical variables are represented by numberic values. I replaced these numeric values by the actual text so that I don’t need to look up the reference table constantly during my analysis.
One of the first things I notice is that there are two types of pets listed: cat and dog. As a “cat person”, my instinction leads me to separate the data by pet type immediately. The two plots below show how the number of pets are distributed according to adoption speed. And of course, separated by cat and dog.
The plot on the LHS shows that only around 2% of the pets are adopted on the same day they are listed on the website, and that roughly 28% of the pets are not adopted after 100 days since listed. The rest 70% are adopted during 1 to 90 days since listed. It also shows that there are slightly more dogs than cats in this data set.
As shown in the plot on the RHS, out of all cats, 25% of them are adopted within 7 days. For dogs, the number is around 20%. On average, cats are adopted faster than dogs.
Because AdoptionSpeed has values in [0, 1, 2, 3, 4, 5] and the lower the value indicates the faster a pet is adopted, it is reasonable to treat AdoptionSpeed as continuous.
Here, I use ANOVA test to see if the adoption speed is different between dogs and cats. Given that p-value is close to 0, we can conclude that the adoption speed is significantly different between dogs and cats under 0.05 significance level. This result also aligns with the findings from the plots above.
## Df Sum Sq Mean Sq F value Pr(>F)
## Type 1 173 172.97 125.8 <2e-16 ***
## Residuals 14991 20605 1.37
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
It is nice to see that most of the adoptions are free, regardless of pet type and adoption speed.
When it does require a fee, adopting a dog tends to be more expensive than adopting a cat.
Is there a correlation between fee and adoption speed? I build a linear regression with AdoptionSpeed ~ Type + Fee to check out the relationship. Controlling for type, the coefficient for Fee is negative with a very small absolute value. This indicates that as fee increases, the expected value for AdoptionSpeed decreases, thus taking shorter time for a pet to be adopted. From the plot above, such correlation is more obvious for adopting dogs, where a higher fee is associated with a faster adoption.
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.5706083055 0.0391494356 65.661440 0.000000000
## TypeDog 0.1280134026 0.0500763150 2.556366 0.010640159
## Fee -0.0004862144 0.0001624044 -2.993850 0.002783826
A larger percent of dogs get dewormed than cats. However, whether a pet gets dewormed treatment does not really help them get adopted faster.
More than half of the cats and dogs are not sterilized. Perhaps it’s up to the future owner to decide whether to have their pet sterilized or not. Without further analysis, it is hard to say whether getting sterilized will help a pet get adopted faster.
Similar to dewormed, a lot more dogs get vaccinated than cats. As for cats, the percent of being vaccinated increases as adoption speed gets slower. However, this is not suggesting that getting vaccinated will make a pet get adopted slower, because the plot only shows associattion not causation. I will need to research on if there is any confounding variable and use causal analysis to make a conclusion.
Selangor and Kuala Lumpur are the two major states that have listed pets for adoption on PetFinder. It is interesting that Kuala Lumpur has more cats than dogs on listing.
I would like to dig deeper on some of the topics when I have more time, such as: